local skel = fk.CreateSkill {
  name = "emo__bixun",
}

Fk:loadTranslationTable{
  ["emo__bixun"] = "逼讯",
  [":emo__bixun"] = "出牌阶段每名角色限一次，你可弃置一张牌并视为对一名其他角色使用【无中生有】，然后其展示手牌，若有你弃置的牌名，你弃置之并对其造成1点伤害。",

  ["#emo__bixun"] = "逼讯：弃置1张牌并视为对1名其他角色使用【无中生有】，若其有同牌名，弃之并揍他",
}

skel:addEffect("active", {
  anim_type = "offensive",
  prompt = "#emo__bixun",
  card_num = 1,
  target_num = 1,
  card_filter = function (self, player, to_select, selected)
    return #selected == 0 and not player:prohibitDiscard(Fk:getCardById(to_select))
  end,
  target_filter = function (self, player, to, selected)
    return #selected == 0 and player ~= to and not table.contains(player:getTableMark("emo__bixun-phase"), to.id)
  end,
  can_use = function(self, player)
    return table.find(Fk:currentRoom().alive_players, function (p)
      return not table.contains(player:getTableMark("emo__bixun-phase"), p.id) and p ~= player
    end) ~= nil
  end,
  times = function (self, player)
    return #table.filter(Fk:currentRoom().alive_players, function (p)
      return not table.contains(player:getTableMark("emo__bixun-phase"), p.id) and p ~= player
    end)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local to = effect.tos[1]
    room:addTableMark(player, "emo__bixun-phase", to.id)
    local name = Fk:getCardById(effect.cards[1]).trueName
    room:throwCard(effect.cards, skel.name, player, player)
    if player.dead then return end
    room:useVirtualCard("ex_nihilo", nil, player, to, skel.name, true)
    if to.dead then return end
    local cards = to:getCardIds("h")
    to:showCards(cards)
    local same = table.filter(cards, function (id)
      return Fk:getCardById(id).trueName == name
    end)
    if not to.dead and #same > 0 then
      local throw = table.filter(same, function (id)
        return table.contains(to.player_cards[Player.Hand], id)
      end)
      if #throw > 0 then
        room:throwCard(throw, skel.name, to, player)
      end
      room:damage { from = player, to = to, damage = 1, skillName = skel.name }
    end
  end,
})

return skel
